{include file="public/head"}
<style>
    .aui-btn::before{
        border: none !important;
    }
</style>
<body>

<header class="aui-header-default aui-header-fixed aui-header-bg">
    <a href="{:url('Index/App')}" class="aui-header-item">
        <i class="aui-icon aui-icon-back-white"></i>
    </a>
    <div class="aui-header-center aui-header-center-clear">
        <div class="aui-header-center-logo">
            <div class="aui-car-white-Typeface" style="color:black;font-weight: bold;">我的订单</div>
        </div>
    </div>
    <a href="#" class="aui-header-item-icon"   style="min-width:0">
<!--        <i class="aui-icon aui-icon-search"></i>-->
    </a>
</header>

<section class="aui-myOrder-content">
    <div class="m-tab demo-small-pitch" data-ydui-tab>
        <div class="aui-myOrder-fix">
            <ul class="tab-nav">
                <li class="tab-nav-item tab-active"><a href="javascript:;">全部</a></li>
                <li class="tab-nav-item"><a href="javascript:;">待付款</a></li>
                <li class="tab-nav-item"><a href="javascript:;">待发货</a></li>
                <li class="tab-nav-item"><a href="javascript:;">待收货</a></li>
                <li class="tab-nav-item"><a href="javascript:;">已完成</a></li>
                <li class="tab-nav-item"><a href="javascript:;">待拼团</a></li>
            </ul>
        </div>
<!--        <div class="aui-prompt"><i class="aui-icon aui-prompt-sm"></i>双十一期间发货及物流时效公告</div>-->
        <div class="tab-panel">
            <div class="tab-panel-item tab-active">
                <ul>
                    {volist name="OrderListAll" id="v"}
                    <li>
                        <div class="aui-list-title-info">
                            <a href="#" class="aui-well ">
                                <div class="aui-well-bd">{$v.add_time|date="Y-m-d H:i:s",###}</div>
                                <div class="aui-well-ft">
                                    {if condition="$v.status eq 0"}待付款
                                    {elseif condition="$v.status eq 1" /}待发货
                                    {elseif condition="$v.status eq 2" /}待收货
                                    {elseif condition="$v.status eq 3" /}交易成功
                                    {elseif condition="$v.status eq 4" /}待拼团
                                    {elseif condition="$v.status eq 5" /}拼团成功
                                    {elseif condition="$v.status eq 11" /}待退款
                                    {elseif condition="$v.status eq 12" /}已退款
                                    {elseif condition="$v.status eq 6" /}<font style="color:red">拼团失败</font>
                                    {/if}
                                </div>
                                    <!--<font id="order_name" onclick="fenx()" order_id="{$v.order_id}">分享</font>-->
                                    {if condition="$v.status eq 4"}
                                    <div class="aui-well aui-btn" style="text-align:right;border:none">
                                         <a class="aui-well-ft red-color" id="order_name" href="{:url('Order/fenx',array('order_id'=>$v.order_id))}" style="color:#fff;position: absolute; right:10px;padding:0rem .5rem;border-radius:8px;" >分享</a>
                                    </div>
                                   {/if}
                                    
                            </a>
                            {volist name='$v.goods' id='val'}
                            <a href="javascript:;" class="aui-list-product-fl-item">
                                <div class="aui-list-product-fl-img">
                                    <img src="{$val.logo_url}" alt="">
                                </div>
                                <div class="aui-list-product-fl-text">
                                    <h3 class="aui-list-product-fl-title">{$val.name}</h3>
                                    <div class="aui-list-product-fl-mes">
                                        <div>
<!--                                            <span class="aui-list-product-item-price"><em>¥</em>{$val.price}</span>-->
                                            <span class="aui-btn-purchase">数量</span>
<!--                                            <span class="aui-list-product-item-del-price">¥495.65</span>-->
                                        </div>
                                        <div class="aui-btn-purchase">
                                            x{$val.num}
                                        </div>
                                    </div>
                                </div>
                            </a>
                            {/volist}
                        </div>
                        <div class="aui-list-title-btn">
                            共计 : {$v.amount}元
                            <a href="{:url('Order/OrderEdit',array('id'=>$v.order_id))}">订单详情</a>
                            {if condition="$v.status eq 0"}
                                <a href="javascript:" order_id="{$v.order_id}" class="delete">取消订单</a>
                                <a href="{:url('Order/OrderPay',array('order_id'=>$v.order_id))}" class="red-color">立即付款</a>
                            {elseif  condition="$v.status eq 1"/}
                                <a href="javascript:" order_id="{$v.order_id}" class="red-color sure">确认收货</a>
                            {elseif  condition="$v.status eq 2"/}
                                <a href="http://m.kuaidi100.com/result.jsp?nu={$v.express_num}">查看物流</a>
                                <a href="javascript:" order_id="{$v.order_id}" class="red-color sure">确认收货</a>
                            {elseif  condition="$v.status eq 3"/}
                                <a href="javascript:" order_id="{$v.order_id}" class="red-color delete">删除订单</a>
                            {/if}
                        </div>
                        <div class="aui-dri"></div>
                    </li>
                    {/volist}
                </ul>
            </div>
            <div class="tab-panel-item">
                <ul>
                    {volist name="OrderList_0" id="v_0"}
                    <li>
                        <div class="aui-list-title-info">
                            <a href="#" class="aui-well ">
                                <div class="aui-well-bd">{$v_0.add_time|date="Y-m-d H:i:s",###}</div>
                                <div class="aui-well-ft">
                                    {if condition="$v_0.status eq 0"}待付款
                                    {elseif condition="$v_0.status eq 1" /}待发货
                                    {elseif condition="$v_0.status eq 2" /}待收货
                                    {elseif condition="$v_0.status eq 3" /}交易成功
                                    {/if}
                                </div>
                            </a>
                            <a href="javascript:;" class="aui-list-product-fl-item">
                                <div class="aui-list-product-fl-img">
                                    <img src="{$v_0.logo_url}" alt="">
                                </div>
                                <div class="aui-list-product-fl-text">
                                    <h3 class="aui-list-product-fl-title">{$v_0.goods_name}</h3>
                                    <div class="aui-list-product-fl-mes">
                                        <div>
<!--                                            <span class="aui-list-product-item-price"><em>¥</em>{$v_0.amount}</span>-->
                                            <span class="aui-btn-purchase">数量</span>
                                            <!--                                            <span class="aui-list-product-item-del-price">¥495.65</span>-->
                                        </div>
                                        <div class="aui-btn-purchase">
                                            x{$v_0.num}
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </div>
                        <div class="aui-list-title-btn">
                            共计 : {$v_0.amount}元
                            {if condition="$v_0.status eq 0"}
                            <a href="javascript:" order_id="{$v_0.order_id}" class="delete">取消订单</a>
                            <a href="{:url('Order/OrderPay',array('order_id'=>$v_0.order_id))}" class="red-color">立即付款</a>
                            {elseif  condition="$v_0.status eq 1"/}
                            <a href="javascript:" order_id="{v_0.order_id}" class="red-color sure">确认收货</a>
                            {elseif  condition="$v_0.status eq 2"/}
                            <a href="http://m.kuaidi100.com/result.jsp?nu={$v_0.express_num}">查看物流</a>
                            <a href="javascript:" order_id="{v_0.order_id}" class="red-color sure">确认收货</a>
                            {elseif  condition="$v_0.status eq 3"/}
                            <a href="javascript:" order_id="{v_0.order_id}" class="red-color delete">删除订单</a>
                            {/if}
                        </div>
                        <div class="aui-dri"></div>
                    </li>
                    {/volist}
                </ul>
            </div>
            <div class="tab-panel-item">
                <ul>
                    {volist name="OrderList_1" id="v_1"}
                    <li>
                        <div class="aui-list-title-info">
                            <a href="#" class="aui-well ">
                                <div class="aui-well-bd">{$v_1.add_time|date="Y-m-d H:i:s",###}</div>
                                <div class="aui-well-ft">
                                    {if condition="$v_1.status eq 0"}待付款
                                    {elseif condition="$v_1.status eq 1" /}待发货
                                    {elseif condition="$v_1.status eq 2" /}待收货
                                    {elseif condition="$v_1.status eq 3" /}交易成功
                                    {/if}
                                </div>
                            </a>
                            <a href="javascript:;" class="aui-list-product-fl-item">
                                <div class="aui-list-product-fl-img">
                                    <img src="{$v_1.logo_url}" alt="">
                                </div>
                                <div class="aui-list-product-fl-text">
                                    <h3 class="aui-list-product-fl-title">{$v_1.goods_name}</h3>
                                    <div class="aui-list-product-fl-mes">
                                        <div>
<!--                                            <span class="aui-list-product-item-price"><em>¥</em>{$v_1.amount}</span>-->
                                            <span class="aui-btn-purchase">数量</span>
                                            <!--                                            <span class="aui-list-product-item-del-price">¥495.65</span>-->
                                        </div>
                                        <div class="aui-btn-purchase">
                                            x{$v_1.num}
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </div>
                        <div class="aui-list-title-btn">
                            共计 : {$v_1.amount}元
                            {if condition="$v_1.status eq 0"}
                            <a href="javascript:" order_id="{$v_1.order_id}" class="delete">取消订单</a>
                            <a href="{:url('Order/OrderPay',array('order_id'=>$v_1.order_id))}" class="red-color">立即付款</a>
                            {elseif  condition="$v_1.status eq 1"/}
                            <a href="javascript:" order_id="{$v_1.order_id}" class="red-color sure">确认收货</a>
                            {elseif  condition="$v_1.status eq 2"/}
                            <a href="http://m.kuaidi100.com/result.jsp?nu={$v_1.express_num}">查看物流</a>
                            <a href="javascript:" order_id="{$v_1.order_id}" class="red-color sure">确认收货</a>
                            {elseif  condition="$v_1.status eq 3"/}
                            <a href="javascript:" order_id="{$v_1.order_id}" class="red-color delete">删除订单</a>
                            {/if}
                        </div>
                        <div class="aui-dri"></div>
                    </li>
                    {/volist}
                </ul>
            </div>
            <div class="tab-panel-item">
                <ul>
                    {volist name="OrderList_2" id="v_2"}
                    <li>
                        <div class="aui-list-title-info">
                            <a href="#" class="aui-well ">
                                <div class="aui-well-bd">{$v_2.add_time|date="Y-m-d H:i:s",###}</div>
                                <div class="aui-well-ft">
                                    {if condition="$v_2.status eq 0"}待付款
                                    {elseif condition="$v_2.status eq 1" /}待发货
                                    {elseif condition="$v_2.status eq 2" /}待收货
                                    {elseif condition="$v_2.status eq 3" /}交易成功
                                    {/if}
                                </div>
                            </a>
                            <a href="javascript:;" class="aui-list-product-fl-item">
                                <div class="aui-list-product-fl-img">
                                    <img src="{$v_2.logo_url}" alt="">
                                </div>
                                <div class="aui-list-product-fl-text">
                                    <h3 class="aui-list-product-fl-title">{$v_2.goods_name}</h3>
                                    <div class="aui-list-product-fl-mes">
                                        <div>
<!--                                            <span class="aui-list-product-item-price"><em>¥</em>{$v_2.amount}</span>-->
                                            <span class="aui-btn-purchase">数量</span>
                                            <!--                                            <span class="aui-list-product-item-del-price">¥495.65</span>-->
                                        </div>
                                        <div class="aui-btn-purchase">
                                            x{$v_2.num}
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </div>
                        <div class="aui-list-title-btn">
                            共计 : {$v_2.amount}元
                            {if condition="$v_2.status eq 0"}
                            <a href="javascript:" order_id="{$v_2.order_id}" class="delete">取消订单</a>
                            <a href="{:url('Order/OrderPay',array('order_id'=>$v_2.order_id))}" class="red-color">立即付款</a>
                            {elseif  condition="$v_2.status eq 1"/}
                            <a href="javascript:" order_id="{$v_2.order_id}" class="red-color sure">确认收货</a>
                            {elseif  condition="$v_2.status eq 2"/}
                            <a href="http://m.kuaidi100.com/result.jsp?nu={$v_2.express_num}">查看物流</a>
                            <a href="javascript:" order_id="{$v_2.order_id}" class="red-color sure">确认收货</a>
                            {elseif  condition="$v_2.status eq 3"/}
                            <a href="javascript:" order_id="{$v_2.order_id}" class="red-color delete">删除订单</a>
                            {/if}
                        </div>
                        <div class="aui-dri"></div>
                    </li>
                    {/volist}
                </ul>
            </div>
            <div class="tab-panel-item">
                <ul>
                    {volist name="OrderList_3" id="v_3"}
                    <li>
                        <div class="aui-list-title-info">
                            <a href="#" class="aui-well ">
                                <div class="aui-well-bd">{$v_3.add_time|date="Y-m-d H:i:s",###}</div>
                                <div class="aui-well-ft">
                                    {if condition="$v_3.status eq 0"}待付款
                                    {elseif condition="$v_3.status eq 1" /}待发货
                                    {elseif condition="$v_3.status eq 2" /}待收货
                                    {elseif condition="$v_3.status eq 3" /}交易成功
                                    {/if}
                                </div>
                            </a>
                            <a href="javascript:;" class="aui-list-product-fl-item">
                                <div class="aui-list-product-fl-img">
                                    <img src="{$v_3.logo_url}" alt="">
                                </div>
                                <div class="aui-list-product-fl-text">
                                    <h3 class="aui-list-product-fl-title">{$v_3.goods_name}</h3>
                                    <div class="aui-list-product-fl-mes">
                                        <div>
                                            <span class="aui-btn-purchase">数量</span>
<!--                                            <span class="aui-list-product-item-price"><em>¥</em>{$v_3.amount}</span>-->
                                            <!--                                            <span class="aui-list-product-item-del-price">¥495.65</span>-->
                                        </div>
                                        <div class="aui-btn-purchase">
                                            x{$v_3.num}
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </div>
                        <div class="aui-list-title-btn">
                            共计 : {$v_3.amount}元
                            {if condition="$v_3.status eq 0"}
                            <a href="javascript:" order_id="{$v_3.order_id}" class="delete">取消订单</a>
                            <a href="{:url('Order/OrderPay',array('order_id'=>$v_3.order_id))}" class="red-color">立即付款</a>
                            {elseif  condition="$v_3.status eq 1"/}
                            <a href="javascript:" order_id="{$v_3.order_id}" class="red-color sure">确认收货</a>
                            {elseif  condition="$v_3.status eq 2"/}
                            <a href="http://m.kuaidi100.com/result.jsp?nu={$v_3.express_num}">查看物流</a>
                            <a href="javascript:" order_id="{$v_3.order_id}" class="red-color sure">确认收货</a>
                            {elseif  condition="$v_3.status eq 3"/}
                            <a href="javascript:" order_id="{$v_3.order_id}" class="red-color delete">删除订单</a>
                            {/if}
                        </div>
                        <div class="aui-dri"></div>
                    </li>
                    {/volist}
                </ul>
            </div>
            <div class="tab-panel-item">
                <ul>
                    {volist name="OrderList_4" id="v_4"}
                    <li>
                        <div class="aui-list-title-info">
                            <a href="#" class="aui-well ">
                                <div class="aui-well-bd">{$v_4.add_time|date="Y-m-d H:i:s",###}</div>
                                <div class="aui-well-ft">
                                    {if condition="$v_4.status eq 0"}待付款
                                    {elseif condition="$v_4.status eq 1" /}待发货
                                    {elseif condition="$v_4.status eq 2" /}待收货
                                    {elseif condition="$v_4.status eq 3" /}交易成功
                                    {elseif condition="$v_4.status eq 4" /}待拼团
                                    <!--<a href="{:url('Order/fenx',array('order_id'=>$v.order_id))}" class="red-color">分享</a>-->
                                    {elseif condition="$v_4.status eq 5" /}拼团成功
                                    {elseif condition="$v_4.status eq 6" /}<font style="color:red">拼团失败</font>
                                    {/if}
                                </div>
                                {if condition="$v.status eq 4"}
                                    <div class="aui-well aui-btn" style="text-align:right;border:none">
                                         <a class="aui-well-ft red-color" id="order_name" href="{:url('Order/fenx',array('order_id'=>$v.order_id))}" style="color:#fff;position: absolute; right:10px;padding:0rem .5rem;border-radius:8px;" >分享</a>
                                    </div>
                                   {/if}
                            </a>
                            <a href="javascript:;" class="aui-list-product-fl-item">
                                <div class="aui-list-product-fl-img">
                                    <img src="{$v_4.logo_url}" alt="">
                                </div>
                                <div class="aui-list-product-fl-text">
                                    <h3 class="aui-list-product-fl-title">{$v_4.goods_name}</h3>
                                    <div class="aui-list-product-fl-mes">
                                        <div>
                                            <span class="aui-list-product-item-price"><em>¥</em>{$v_4.amount}</span>
                                            <!--                                            <span class="aui-list-product-item-del-price">¥495.65</span>-->
                                        </div>
                                        <div class="aui-btn-purchase">
                                            x{$v_4.num}
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </div>
                        <!--<div class="aui-list-title-btn">-->
                        <!--    {if condition="$v_4.status eq 0"}-->
                        <!--    <a href="javascript:" order_id="{$v.order_id}" class="delete">取消订单</a>-->
                        <!--    <a href="{:url('Order/OrderPay',array('order_id'=>$v.order_id))}" class="red-color">立即付款</a>-->
                        <!--    {elseif  condition="$v_4.status eq 1"/}-->
                        <!--    <a href="javascript:" order_id="{$v.order_id}" class="red-color sure">确认收货</a>-->
                        <!--    {elseif  condition="$v_4.status eq 2"/}-->
                        <!--    <a href="http://m.kuaidi100.com/result.jsp?nu={$v.express_num}">查看物流</a>-->
                        <!--    <a href="javascript:" order_id="{$v.order_id}" class="red-color sure">确认收货</a>-->
                        <!--    {elseif  condition="$v_4.status eq 3"/}-->
                        <!--    <a href="javascript:" order_id="{$v.order_id}" class="red-color delete">删除订单</a>-->
                        <!--    {/if}-->
                        <!--</div>-->
                        <div class="aui-dri"></div>
                    </li>
                    {/volist}
                </ul>
            </div>
        </div>
    </div>
</section>


<script type="text/javascript" src="__STATIC__/User/js/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/User/js/aui.js"></script>
<script type="text/javascript" >
    $(function () {

        //删除订单
        $(".delete").on('click',function(){
            var order_id = $(this).attr('order_id');
            if(confirm("确定删除该订单吗？")){
                $.ajax({
                    type:"POST",
                    url:"{:url('Order/OrderDelete')}",
                    data:{
                        order_id:order_id,
                    },
                    dataType:"json",
                    success:function(data){
                        if(data.status == 1){
                            alert(data.message);
                            window.location.reload();
                        }else{
                            alert(data.message);
                        }
                    }
                })
            }
        })

        //确认收货
        $(".sure").on('click',function(){
            var order_id = $(this).attr('order_id');
            if(confirm("确定已收货吗？")){
                $.ajax({
                    type:"POST",
                    url:"{:url('Order/OrderSure')}",
                    data:{
                        order_id:order_id,
                    },
                    dataType:"json",
                    success:function(data){
                        if(data.status == 1){
                            alert(data.message);
                            window.location.reload();
                        }else{
                            alert(data.message);
                        }
                    }
                })
            }
        })
        
    })
    
    // //分享
    // function fenx(){
    //     var order_id = $('#order_name').attr('order_id');
    //     $.ajax({
    //         type:"POST",
    //         url:"{:url('Order/fenx')}",
    //         data:{
    //             order_id:order_id,
    //         },
    //         dataType:"json",
    //         success:function(data){
    //             if(data.status == 1){
    //                 alert(data.message);
    //                 // window.location.reload();
    //             }else{
    //                 alert(data.message);
    //             }
    //         }
    //     })
    // }
    
</script>
</body>
</html>